package liming.ai.tool;

import liming.tool.file.FileRW;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class ReInput {
    public void input(FileRW.FileEncoding encoding, InputInterface inputInterface) throws IOException {
        Scanner scanner = new Scanner(new InputStreamReader(System.in, encoding.getValue()));
        while (inputInterface.input(scanner.nextLine()));
    }
    @FunctionalInterface
    public interface InputInterface{
        boolean input(String input) throws IOException;
    }
}
